﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Diagonal.Biztalk.SchemaExplorer._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>BizTalk Schema Explorer</title>
</head>
<body>
    <form id="form1" runat="server">
    <h1>Biztalk Schema Explorer</h1>
    <p>Rows to display
        <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" 
            onselectedindexchanged="DropDownList1_SelectedIndexChanged">
            <asp:ListItem Value="25"></asp:ListItem>
            <asp:ListItem>50</asp:ListItem>
            <asp:ListItem>100</asp:ListItem>
            <asp:ListItem>All</asp:ListItem>
        </asp:DropDownList>
    </p>
    <div>
        <asp:ListView ID="ListView1" runat="server" DataSourceID="ObjectDataSource1">
            <ItemTemplate>
                <tr style="background-color:#DCDCDC;color: #000000;">
                    <td>
                        <asp:Label ID="ApplicationLabel" runat="server" 
                            Text='<%# Eval("Application") %>' />
                    </td>
                    <td>
                        <asp:Label ID="VersionLabel" runat="server" Text='<%# Eval("Version") %>' />
                    </td>
                    <td>
                        <asp:HyperLink 
                            ID="SchemaNameLabel" 
                            runat="server" 
                            Text='<%# Eval("SchemaName") %>'  
                            NavigateUrl='<%# "Schema" + "/" +  Eval("Version") + "/" + Eval("SchemaName")  %>'
                            />
                    </td>
                </tr>
            </ItemTemplate>
            <AlternatingItemTemplate>
                <tr style="background-color:#FFF8DC;">
                    <td>
                        <asp:Label ID="ApplicationLabel" runat="server" 
                            Text='<%# Eval("Application") %>' />
                    </td>
                    <td>
                        <asp:Label ID="VersionLabel" runat="server" Text='<%# Eval("Version") %>' />
                    </td>
                    <td>
                        <asp:HyperLink 
                            ID="SchemaNameLabel" 
                            runat="server" 
                            Text='<%# Eval("SchemaName") %>'  
                            NavigateUrl='<%# "Schema" + "/" +  Eval("Version") + "/" + Eval("SchemaName")  %>'
                            />
                    </td>
                </tr>
            </AlternatingItemTemplate>
            <EmptyDataTemplate>
                <table runat="server" 
                    style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;">
                    <tr>
                        <td>
                            No data was returned.</td>
                    </tr>
                </table>
            </EmptyDataTemplate>
            <InsertItemTemplate>
                <tr style="">
                    <td>
                        <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                            Text="Insert" />
                        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                            Text="Clear" />
                    </td>
                    <td>
                        <asp:TextBox ID="ApplicationTextBox" runat="server" 
                            Text='<%# Bind("Application") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="VersionTextBox" runat="server" Text='<%# Bind("Version") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="SchemaNameTextBox" runat="server" 
                            Text='<%# Bind("SchemaName") %>' />
                    </td>
                </tr>
            </InsertItemTemplate>
            <LayoutTemplate>
                <table runat="server">
                    <tr runat="server">
                        <td runat="server">
                            <table ID="itemPlaceholderContainer" runat="server" border="1" 
                                style="background-color: #FFFFFF;border-collapse: collapse;border-color: #999999;border-style:none;border-width:1px;font-family: Verdana, Arial, Helvetica, sans-serif;">
                                <tr runat="server" style="background-color:#DCDCDC;color: #000000;">
                                    <th runat="server">
                                        Application</th>
                                    <th runat="server">
                                        Version</th>
                                    <th runat="server">
                                        SchemaName</th>
                                </tr>
                                <tr ID="itemPlaceholder" runat="server">
                                </tr>
                            </table>
                        </td>
                    </tr>
                    <tr runat="server">
                        <td runat="server" 
                            style="text-align: center;background-color: #CCCCCC;font-family: Verdana, Arial, Helvetica, sans-serif;color: #000000;">
                        </td>
                    </tr>
                </table>
            </LayoutTemplate>
            <EditItemTemplate>
                <tr style="background-color:#008A8C;color: #FFFFFF;">
                    <td>
                        <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                            Text="Update" />
                        <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                            Text="Cancel" />
                    </td>
                    <td>
                        <asp:TextBox ID="ApplicationTextBox" runat="server" 
                            Text='<%# Bind("Application") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="VersionTextBox" runat="server" Text='<%# Bind("Version") %>' />
                    </td>
                    <td>
                        <asp:TextBox ID="SchemaNameTextBox" runat="server" 
                            Text='<%# Bind("SchemaName") %>' />
                    </td>
                </tr>
            </EditItemTemplate>
            <SelectedItemTemplate>
                <tr style="background-color:#008A8C;font-weight: bold;color: #FFFFFF;">
                    <td>
                        <asp:Label ID="ApplicationLabel" runat="server" 
                            Text='<%# Eval("Application") %>' />
                    </td>
                    <td>
                        <asp:Label ID="VersionLabel" runat="server" Text='<%# Eval("Version") %>' />
                    </td>
                    <td>
                        <asp:Label ID="SchemaNameLabel" runat="server" 
                            Text='<%# Eval("SchemaName") %>' />
                    </td>
                </tr>
            </SelectedItemTemplate>
        </asp:ListView>
        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
            MaximumRowsParameterName="500" SelectMethod="GetAllSchemasAsList" 
            StartRowIndexParameterName="1" 
            TypeName="Diagonal.Biztalk.SchemaExplorer.GetSchema">
        </asp:ObjectDataSource>
    </div>
    <asp:DataPager ID="DataPager1" runat="server" PagedControlID="ListView1" 
        QueryStringField="a" PageSize="25">
        <Fields>
            <asp:NextPreviousPagerField 
                ButtonType="Button" 
                ShowFirstPageButton="True" 
                ShowNextPageButton =false
                ShowLastPageButton=false />
            <asp:NumericPagerField />
            <asp:NextPreviousPagerField 
                ButtonType="Button" 
                ShowFirstPageButton=false
                ShowPreviousPageButton=false
                ShowLastPageButton="True" />

        </Fields>
    </asp:DataPager>
    </form>
</body>
</html>
